using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter21
{
	/// <summary>
	/// Example02: Heating a Cylinder of Helium
	/// A cylinder contains 3.0 mol of helium gas at a 
	/// temperature of 300 K.
	/// (A) If the gas is heated at constant volume, how much energy 
	/// must be transferred by heat to the gas for its temperature 
	/// to increase to 500 K?
	/// Q = 7.5 \times 10^3 J
	/// (B) How much energy must be transferred by heat to the
	/// gas at constant pressure to raise the temperature to 500 K?
	/// Q = 12.5 \times 10^3 J 
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.IdealGas helium = new L.IdealGas();
			helium.Mole = 3.0;
			double heat = 3.0/2.0*helium.Mole*L.Constant.UniversalGasConstant
				*(500.0-300.0);
			//(A)
			result+=Convert.ToString(heat);
			double heat2 = 5.0/2.0*helium.Mole*L.Constant.UniversalGasConstant
				*(500.0-300.0);
			result+="\r\n"+Convert.ToString(heat2);
		
		}
	}
}
